<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><ui:composition xmlns="http://www.w3.org/1999/xhtml"
   <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">
    <ui:define name="content">   
        <h:form>
        <p:panel id="panel" header="Change Branch Info">
            <p:ajaxStatus style="width:16px;height:16px;">
                <f:facet name="start">
                    <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                </f:facet>
                <f:facet name="complete">
                    <h:outputText value="" />
                </f:facet>
            </p:ajaxStatus>
            <p:messages />
            <h:panelGrid columns="3" cellpadding="10">
                <h:outputLabel for="branchname" style="font-weight: bold" value="Branch name: " />
                <h:outputText value="#{stakeholderManagerBean.selectedBranch.name}" />

                <h:outputLabel for="blank" style="font-weight: bold" value=""/>
                <p:dataTable var="packagePurchased" value="#{stakeholderManagerBean.packagePurchased}">
                    <p:column headerText="Name">
                        <h:outputText value="#{packagePurchased.servicePackage.name}" />
                    </p:column>

                    <p:column headerText="Description">
                        <h:outputText value="#{packagePurchased.servicePackage.description}" />
                    </p:column>

                    <p:column headerText="Price">
                        <h:outputText value="#{packagePurchased.servicePackage.price}" />
                    </p:column>

                    <p:column headerText="Date Purchased">
                        <h:outputText value="#{packagePurchased.datePurchased}" />
                    </p:column>
                    <p:column headerText="Date Expired">
                        <h:outputText value="#{packagePurchased.dateExpired}" />
                    </p:column>
                </p:dataTable>

                <h:outputLabel for="blank" style="font-weight: bold" value=""/>
                <p:dataTable var="servicePackage" value="#{stakeholderManagerBean.servicePackages}" selection="#{stakeholderManagerBean.selectedServicePackage}" paginator="true" rows="10">
                    <p:column selectionMode="single" />

                    <p:column headerText="Name">
                        <h:outputText value="#{servicePackage.name}" />
                    </p:column>

                    <p:column headerText="Description">
                        <h:outputText value="#{servicePackage.description}" />
                    </p:column>

                    <p:column headerText="Price">
                        <h:outputText value="#{servicePackage.price}" />
                    </p:column>
                </p:dataTable>
                <p:calendar value="#{stakeholderManagerBean.dateExpired}"/>
            </h:panelGrid>
            <p:commandButton id="btn" value="Save Branch Info" update="panel" actionListener="#{stakeholderManagerBean.editPackagePurchasedInfo}" />
        </p:panel>
        </h:form>
    </ui:define>
</ui:composition>
